import java.util.Arrays;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86186
 * Date: 2023-09-22
 * Time: 20:09
 */
public class Test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        long[] arr = new long[3 * n];
        for(int i = 0; i < 3 * n; i++) {
            arr[i] = scanner.nextInt();
        }
        PriorityQueue<Long> queue = new PriorityQueue<>(2 * n,new Comparator<Long>() {
            @Override
            public int compare(Long o1, Long o2) {
                return o2.compareTo(o1);
            }
        });
        for(int i = 0; i < 3 * n; i++) {
            queue.offer(arr[i]);
        }
        for(int i = 0; i < n; i++) {
            queue.poll();
        }
        long sum = 0;
        while(!queue.isEmpty()) {
            sum += queue.poll();
        }

        System.out.println(sum);

        String str = "12412341";
        int a = Integer.parseInt(str);
    }
}
